

package com.hazelcast.jet.impl.submitjob.clientside.execute;

import com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl;
import com.hazelcast.internal.util.UuidUtil;
import com.hazelcast.jet.impl.submitjob.clientside.SubmitJobTargetMemberFinder;

import java.nio.file.Path;
import java.util.UUID;

/**
 * Holds calculated parameters required for direct job execution
 */
public class JobExecuteCall {

    private UUID sessionId;

    private UUID memberUuid;

    private String jarPath;


    public void initializeJobExecuteCall(HazelcastClientInstanceImpl client, Path jarPath) {
        this.sessionId = UuidUtil.newSecureUUID();
        this.jarPath = jarPath.toString();

        // Find the destination member
        SubmitJobTargetMemberFinder submitJobTargetMemberFinder = new SubmitJobTargetMemberFinder();
        this.memberUuid = submitJobTargetMemberFinder.getRandomMemberId(client);
    }

    public UUID getSessionId() {
        return sessionId;
    }

    public UUID getMemberUuid() {
        return memberUuid;
    }

    public String getJarPath() {
        return jarPath;
    }

    public String getSha256HexOfJar() {
        return "";
    }
}
